/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.latesis.bean;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;

/**
 *
 * @author Alan - Desarrollo
 */
@Entity
@Table(name = "TBL_ALERTA_ENVIADA")
public class AlertaEnviadaBean implements Serializable {

    private Long id;
    private Date fechaEnvio;
    private String estadoAlerta;
    private Double latitud;
    private Double longitud;
    private AlertaBean alerta;
    
    private ChoferBean chofer;
    private MovilBean movil;

    public AlertaEnviadaBean() {

    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    @Column(name = "fechaEnvio", nullable = false)
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    public Date getFechaEnvio() {
        return fechaEnvio;
    }

    @Column(name = "estadoAlerta", nullable = false, length = 1)
    public String getEstadoAlerta() {
        return estadoAlerta;
    }

    @Column(name = "latitud", nullable = true)
    public Double getLatitud() {
        return latitud;
    }

    @Column(name = "longitud", nullable = true)
    public Double getLongitud() {
        return longitud;
    }

    @ManyToOne(optional = false, fetch = FetchType.EAGER)
    @JoinColumn(name = "alertaId")
    public AlertaBean getAlerta() {
        return alerta;
    }
    
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    @JoinColumn(name="choferId")
    public ChoferBean getChofer() {
        return chofer;
    }

    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    @JoinColumn(name="movilId")
    public MovilBean getMovil() {
        return movil;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setFechaEnvio(Date fechaEnvio) {
        this.fechaEnvio = fechaEnvio;
    }

    public void setEstadoAlerta(String estadoAlerta) {
        this.estadoAlerta = estadoAlerta;
    }

    public void setLatitud(Double latitud) {
        this.latitud = latitud;
    }

    public void setLongitud(Double longitud) {
        this.longitud = longitud;
    }

    public void setAlerta(AlertaBean alerta) {
        this.alerta = alerta;
    }   

    public void setChofer(ChoferBean chofer) {
        this.chofer = chofer;
    }

    public void setMovil(MovilBean movil) {
        this.movil = movil;
    }

}
